package com.zhr.handler;

import java.util.ArrayList;
import java.util.List;

import com.zhr.bean.Article;
import com.zhr.server.WeixinRequest;
import com.zhr.server.WeixinResponse;
import com.zhr.type.MsgType;

public class MessageImageHandler extends MessageAbstractHandler {

	@Override
	public WeixinResponse handle(WeixinRequest request) {
		WeixinResponse response = super.handle(request);
		response.setFuncFlag("1");
		response.setMsgType(MsgType.news.name());
		response.setArticleCount("1");
		List<Article> articles = new ArrayList<Article>();
		Article article = new Article();
		article.setTitle("图片");
		article.setDescrption("好赞的图哇");
		article.setUrl(request.getPicUrl());
		article.setPicUrl(request.getPicUrl());
		articles.add(article);
		response.setArticles(articles);
		return response;
	}

	@Override
	public int getPriority() {
		return MIN_PRIORITY;
	}

	@Override
	public boolean accpet(WeixinRequest request) {
		return true;
	}

}
